package com.example.helloandroidworld;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.telephony.SmsManager;
import android.widget.Toast;
    
public class smsAction extends BroadcastReceiver 
{

	@Override
	public void onReceive(Context myContent, Intent myIntent) 
	{
		sendSMS(myIntent.getStringExtra("phoneNumber"),myIntent.getStringExtra("message"), myContent);	
	}
	
	private void sendSMS( String phoneNumber, String message, Context myContext)
	{
		Toast.makeText(myContext, "Enter all request input", Toast.LENGTH_SHORT).show();
		Intent i = new Intent(myContext.getApplicationContext(),MessagingReminder.class);
		PendingIntent pi = PendingIntent.getBroadcast(myContext, 0, i, 0);
		SmsManager managerTool = SmsManager.getDefault();
		managerTool.sendTextMessage(phoneNumber, null, message, pi, null);
	}	
}